package cn.huiyunche.base.service.vo;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Calendar;
import java.util.Date;

/**
 * 上线／刷新排队
 *
 * @author houjianhui
 */
public class DWaybillDoneVo implements Serializable {

    private static final long serialVersionUID = 5966862925623802079L;

    private Long id;

    private String orderCode; // 中联TMS订单编号

    private Date orderTime; // 下单时间

    private String departProvince; // 发车省

    private String departCity; // 发车市

    private String arrivalProvince; // 送达省

    private String arrivalCity; // 送达市

    private String vehicleTypeName;

    private BigDecimal distance;

    private String departAddr; // 发车地址
    private String arrivalAddr; // 目的地址

    // 订单上显示的月份 文本
    private String monthText;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getOrderCode() {
        return orderCode;
    }

    public void setOrderCode(String orderCode) {
        this.orderCode = orderCode;
    }

    public Date getOrderTime() {
        return orderTime;
    }

    public void setOrderTime(Date orderTime) {
        this.orderTime = orderTime;
    }

    public String getDepartProvince() {
        return departProvince;
    }

    public void setDepartProvince(String departProvince) {
        this.departProvince = departProvince;
    }

    public String getDepartCity() {
        return departCity;
    }

    public void setDepartCity(String departCity) {
        this.departCity = departCity;
    }

    public String getArrivalProvince() {
        return arrivalProvince;
    }

    public void setArrivalProvince(String arrivalProvince) {
        this.arrivalProvince = arrivalProvince;
    }

    public String getArrivalCity() {
        return arrivalCity;
    }

    public void setArrivalCity(String arrivalCity) {
        this.arrivalCity = arrivalCity;
    }

    public String getVehicleTypeName() {
        return vehicleTypeName;
    }

    public void setVehicleTypeName(String vehicleTypeName) {
        this.vehicleTypeName = vehicleTypeName;
    }

    public BigDecimal getDistance() {
        return distance;
    }

    public void setDistance(BigDecimal distance) {
        this.distance = distance;
    }

    public String getDepartAddr() {
        return departAddr;
    }

    public void setDepartAddr(String departAddr) {
        this.departAddr = departAddr;
    }

    public String getArrivalAddr() {
        return arrivalAddr;
    }

    public void setArrivalAddr(String arrivalAddr) {
        this.arrivalAddr = arrivalAddr;
    }

    public String getMonthText() {
        orderTime = null == orderTime ? new Date() : orderTime;
        Calendar c = Calendar.getInstance();
        int currentYear = c.get(Calendar.YEAR);
        c.setTime(orderTime);
        monthText = c.get(Calendar.MONTH) + 1 + "月";
        int year = c.get(Calendar.YEAR);
        if (year != currentYear) {
            monthText = year + "年" + monthText;
        }
        return monthText;
    }

    public void setMonthText(String monthText) {
        this.monthText = monthText;
    }

    @Override
    public String toString() {
        return "DWaybillDoneVo [id=" + id + ", orderCode=" + orderCode + ", orderTime=" + orderTime
                + ", departProvince=" + departProvince + ", departCity=" + departCity + ", arrivalProvince="
                + arrivalProvince + ", arrivalCity=" + arrivalCity + ", vehicleTypeName=" + vehicleTypeName
                + ", distance=" + distance + ", departAddr=" + departAddr + ", arrivalAddr=" + arrivalAddr
                + ", monthText=" + monthText + "]";
    }

}
